import { Singleton } from '../../framework/common/Singleton';
import { Npc } from '../entity/npc/npc';
import npcData from '../json/npc/npc_1.json';

/**
 * NPC管理器 / NPC Manager
 */
export class NpcMgr extends Singleton<NpcMgr>() {
    private npcMap: Map<string, Npc> = new Map();
    public start(id: number | string): void {
        if (id === 100464748) {
            npcData.ids.forEach((npcId) => {
                const npcConfig =
                    npcData.configs[npcId as keyof typeof npcData.configs];
                const npc = new Npc();
                npc.start(npcConfig);
                this.npcMap.set(npcId, npc);
            });
        }
    }
}
